//
//  WithDrawListController.m
//  rdxny
//
//  Created by nsm on 2018/5/5.
//  Copyright © 2018年 rdxny. All rights reserved.
//

#import "WithDrawListController.h"
#import "WithDrawListCell.h"

@interface WithDrawListController ()

@end

@implementation WithDrawListController

#pragma mark - lifeCycle

#pragma mark - override

#pragma mark - initialization
- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self initTableView];
}

- (void)initTableView {
    self.tableView.height = kScreenHeight-kNavBarHeight;
    self.tableView.estimatedRowHeight = 80;
    
    self.tableView.headerRefreshEnabled = YES;
    self.tableView.footerRefreshEnabled = YES;
    self.tableView.emptySetEnabled = YES;
    self.tableView.urlString = @"mine/withdrawList.html";
    
    @nsm_weak(self)
    self.tableView.sourceManager.classForCellAtIndexPath = ^Class(NSIndexPath *indexPath) {
        return [WithDrawListCell class];
    };
    self.tableView.didRefreshingHeaderSuccess = ^(id responseObject) {
        @nsm_strong(self)
        id data = ((NSMResponseObject *)responseObject).data;
        self.tableView.sourceManager.dataArray = [NSMutableArray arrayWithArray:data[@"list"]];
    };
    self.tableView.didRefreshingFooterSuccess = ^(id responseObject) {
        @nsm_strong(self)
        id data = ((NSMResponseObject *)responseObject).data;
        [self.tableView.sourceManager.dataArray addObjectsFromArray:data[@"list"]];
    };
    self.tableView.didRefreshingHeaderEmpty = ^(id responseObject) {
        @nsm_strong(self)
        self.tableView.imageForEmptySet = kEmptyDataImage;
        self.tableView.titleForEmptySet = kEmptyDataDesc(((NSMResponseObject *)responseObject).desc);
    };
    [self.tableView beginRefreshing:RefreshHudDefault];
}

#pragma mark - setter/getter

#pragma mark - network

#pragma mark - method/public

#pragma mark - method/private

#pragma mark - action
- (void)showList {
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}

@end
